package com.javatest.validate;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @date 2020-11-10 下午3:03
 */
public class ValidatorTest13 {
    public static void main(String[] args) {
        List<@NotNull Room> beans = new ArrayList<>();
        beans.add(null);
        beans.add(new Room());

        Room room = new Room();
        room.name = "YourBatman";
        beans.add(room);

        // 必须基于Java Bean，验证才会生效
        Rooms rooms = new Rooms(beans);
        ValidationUtils.printViolations(ValidationUtils.obtainValidator()
                .validate(rooms));
    }
}
